<template>
  <div class="app-container">
    <!--    <vehicleTopDetails v-model="detailForm"/>-->

    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="基础信息" name="jcxx">
        <basics-message v-if="activeName === 'jcxx'" v-model="detailForm"/>
      </el-tab-pane>

      <el-tab-pane label="保险信息" name="bxxx">
        <insurance-message v-if="activeName === 'bxxx'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="购置税信息" name="gzsxx">
        <purchase-message v-if="activeName === 'gzsxx'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="上牌信息" name="spxx">
        <el-sp :carId="detailForm.carId" v-if="activeName === 'spxx'" :dataObj="detailForm"/>
      </el-tab-pane>

      <el-tab-pane label="GPS信息" name="gpsxx">
        <gps-message v-if="activeName === 'gpsxx'" :vinNo="detailForm.vinNo"/>
      </el-tab-pane>

      <el-tab-pane label="装饰信息" name="zsxx">
        <el-zs :carId="detailForm.carId" v-if="activeName === 'zsxx'" :dataObj="detailForm"/>
      </el-tab-pane>

      <el-tab-pane label="合同订单信息" name="htxx">
        <contract-message v-if="activeName === 'htxx'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="车辆入库" name="clrk">
        <vehicle-storage-message v-if="activeName === 'clrk'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="车辆出库" name="clck">
        <vehicle-delivery-message v-if="activeName === 'clck'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="还车入库信息" name="hcrk">
        <return-storage-message v-if="activeName === 'hcrk'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="维修信息" name="wxxx">
        <repair-message v-if="activeName === 'wxxx'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="保养信息" name="byxx">
        <maintenance-message v-if="activeName === 'byxx'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="年检信息" name="njxx">
        <inspection-message v-if="activeName === 'njxx'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <el-tab-pane label="违章信息" name="wzxx">
        <violation-message v-if="activeName === 'wzxx'" :carId="detailForm.carId"
                           :carNo="detailForm.carNo"/>
      </el-tab-pane>

      <el-tab-pane label="更换轮胎信息" name="ghlt">
        <change-wheel-message v-if="activeName === 'ghlt'" :carId="detailForm.carId"/>
      </el-tab-pane>

      <!--      <el-tab-pane label="处置信息" name="czxx">-->
      <!--        <disposal-message v-if="activeName === 'czxx'" v-model="detailForm"/>-->
      <!--      </el-tab-pane>-->
<!--todo 先注释-->
<!--        <el-tab-pane label="车辆调拨" name="allocate">-->
<!--            <allocate-message v-if="activeName === 'allocate'" :carId="detailForm.carId"/>-->
<!--        </el-tab-pane>-->

<!--        <el-tab-pane label="车辆过户" name="transfer">-->
<!--            <transfer-message v-if="activeName === 'transfer'" :carId="detailForm.carId"/>-->
<!--        </el-tab-pane>-->
    </el-tabs>
    <el-card shadow="never">
      <div style="display: flex;align-items: center;justify-content: flex-end">
        <el-button size="mini" @click="handleBack">返回</el-button>
      </div>
    </el-card>
  </div>
</template>

<script>
import elZs from "./components/zsxx.vue";
import elSp from "./components/spxx.vue";
import {getToken} from "@/utils/auth";
import {getCarBasic} from "@/api/zcwh/vehicleFilesaApi.js";

export default {
  name: "vehicleDetails",
  dicts: ["car_business_type", "insurance_status", "contract_type", "car_type"],
  components: {
    elZs,
    elSp,

    vehicleTopDetails: () => import("./components/vehicleTopDetails.vue"), //顶部信息
    //tabs: 信息
    basicsMessage: () => import("./components/basicsMessage"), //基础信息
    insuranceMessage: () => import("./components/insuranceMessage"), //保险信息
    purchaseMessage: () => import("./components/purchaseMessage"), //购置税信息
    gpsMessage: () => import("./components/gpsMessage"), //GPS信息
    contractMessage: () => import("./components/contractMessage"), // 合同订单信息
    vehicleStorageMessage: () => import("./components/vehicleStorageMessage"), //车辆入库
    vehicleDeliveryMessage: () => import("./components/vehicleDeliveryMessage"), //车辆出库
    returnStorageMessage: () => import("./components/returnStorageMessage"), //还车入库信息
    repairMessage: () => import("./components/repairMessage"), //维修信息
    maintenanceMessage: () => import("./components/maintenanceMessage"), //保养信息
    inspectionMessage: () => import("./components/inspectionMessage"), //年检信息
    violationMessage: () => import("./components/violationMessage"), //违章信息
    changeWheelMessage: () => import("./components/changeWheelMessage"), //更换轮胎信息
    disposalMessage: () => import("./components/disposalMessage"), //处置信息
    allocateMessage: () => import("./components/allocateMessage"), //调拨信息
    transferMessage: () => import("./components/transferMessage"), //过户信息
  },
  data() {
    return {
      isForm: false,
      routeQuery: {},
      activeName: "jcxx",
      detailForm: {},

      dataList: [],
    };
  },
  watch: {},
  computed: {},
  created() {
    this.routeQuery = this.$route.query;
    this.getCarBasic();
  },
  methods: {
    pageReturn() {
      this.$router.push({
        path: "/clgl/vehicleFiles",
      });
    },
    handleClick(tab, event) {
    },
    getCarBasic() {
      getCarBasic(this.routeQuery.carId).then((res) => {
        if (res.code === 200) {
          this.detailForm = res.data || {};

          this.isForm = true;
        }
      });
    },
    handleBack() {
      this.$tab.closePage().then(({visitedViews}) => {
        this.$router.push({
          path: '/clgl/vehicleFiles'
        });
      });
    }
  },
};
</script>


<style lang="scss" scoped>
</style>
